############# ########### ####### ##### ### ##
#
# Copyright (C) 2010 The Hursk Group, LLC
#
# This program is free software: you can redistribute it and/or modify 
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program (See file named COPYING).  If not, see 
# <http://www.gnu.org/licenses/>.
# 
############# ########### ####### ##### ### ##

#!/bin/bash
#
#
# full relative to this script path to dir containing system data to be assessed
base_url=/change/me/to/file/location
# path to errata html files
#errata_store_dir=redhat_9/

# go get the current matrix
wget  -O - ftp://ftp.itrc.hp.com/export/patches/hp-ux_patch_matrix > hp-ux_patch_matrix


for host_name in `ls $base_url`
do
	for patch_lvl in `cat $base_url$host_name/swlist_PH.out | cut -f3 -d" " | cut -f1`
	do	
		hit=`grep $patch_lvl hp-ux_patch_matrix`
		if [ "$hit" ]; then
			echo $patch_lvl
		fi
		
		hit=
	done
done